package com.itheima.bos.web.action.transit;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.itheima.bos.domain.transit.DeliveryInfo;
import com.itheima.bos.service.transit.DeliveryInfoService;
import com.itheima.bos.web.action.common.BaseAction;
	/*
	 * 开始配送功能
	 */
@Namespace("/")
@ParentPackage("json-default")
@Scope("prototype")
@Controller
public class DeliveryAction extends BaseAction<DeliveryInfo>{

	@Autowired
	private DeliveryInfoService deliveryService;
	
	private String transitInfoId;

	public void setTransitInfoId(String transitInfoId) {
		this.transitInfoId = transitInfoId;
	}
	
	@Action(value = "delivery_save", results = {
			@Result(name = "success", type = "redirect", location = "/pages/transit/transitinfo.html") })
	public String save() {
		
		deliveryService.save(transitInfoId,model);
		return SUCCESS;
	}
}
